<script lang="ts" setup>
import { onMounted, PropType } from 'vue'
import { Command } from '@/commands/command.ts'
import { dbus } from '@/dbus/dbus.ts'

const props = defineProps({
    command: { required: true, type: Object as PropType<Command> },
})

onMounted(async () => {
    props.command!.execute().finally(async () => {
        dbus.emit('scroll-to-bottom')
    })
})
</script>

<template>
    <n-space :wrap="false" :wrap-item="false" align="center">
        <div class="session-message">{{ props.command!.output }}</div>
    </n-space>
</template>

<style lang="scss" scoped></style>
